package com.xyh.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author:kyle
 * @Date:2020/12/23 - 16:43
 * @Project:spring_StudentsDormitoryManagementSystem
 * @Package:com.xyh.po
 * @Version:1.0
 */
@Getter
@Setter
@NoArgsConstructor
@Component
@TableName("t_class")
public class MyClass implements Serializable {
    @TableId(value = "class_pkid",type = IdType.AUTO)
    private Integer id;
    @TableField(value = "class_name")
    private String classname;
    @TableField(value = "class_teacher")
    private String teacher;
    @TableField(value = "class_createtime")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @Override
    public String toString() {
        return "MyClass{" +
                "id=" + id +
                ", classname='" + classname + '\'' +
                ", teacher='" + teacher + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
